import axios from '@/utils/request'

 import config from '@/common/config'

let base = config.getArcBasePath();

/**-------------------------与后端通讯接口------------------请写在下面-------------------------------------------- */
/**
 * 档案附件表
 *1    默认只开放普通查询，所有查询，只要上传	 分页参数 {pageNum:当前页码从1开始,pageSize:每页记录数,total:总记录【数如果是0后台会自动计算总记录数非0不会自动计算】}，后台都会自动按分页查询 其它 api用到再打开，没用到的api请注释掉，
 *2 查询、新增、修改的参数格式  params={id:'主键 主键',name:'附件名称',url:'访问路径',relativePath:'硬盘存放路径',fileSuffix:'后缀名',cdnUrl:'内容加速器访问路径',isImg:'是否图片',archiveId:'档案主编号',isCdn:'是否使用CDN',rootPath:'根目录',createDate:'存入时间',canDown:'是否可下载',canDel:'是否可删除',canRead:'是否可读',bizId:'业务编号、产品编号、商品编号等',remark:'业务名称、产品名称、商品名称等',storeName:'存储名字',fileSize:'文件大小',branchId:'云用户机构编号',deptid:'部门编号',archiveType:'0|知识库',categoryId:'分类编号'}
 **/
 
//普通查询 条件之间and关系  
export const listAttachment = params => { return axios.get(`${base}/mdp/arc/att/attachment/list`, { params: params }); };

//普通查询 条件之间and关系
export const queryAttachmentById = params => { return axios.get(`${base}/mdp/arc/att/attachment/queryById`, { params: params }); };

//删除一条档案附件表 params={id:'主键 主键'}
export const delAttachment = params => { return axios.post(`${base}/mdp/arc/att/attachment/del`,params); };

//批量删除档案附件表  params=[{id:'主键 主键'}]
export const batchAddAttachment = params => { return axios.post(`${base}/mdp/arc/att/attachment/batchAdd`, params); };

//批量删除档案附件表  params=[{id:'主键 主键'}]
export const batchDelAttachment = params => { return axios.post(`${base}/mdp/arc/att/attachment/batchDel`, params); };

//修改一条档案附件表记录
export const editAttachment = params => { return axios.post(`${base}/mdp/arc/att/attachment/edit`, params); };

//新增一条档案附件表
export const addAttachment = params => { return axios.post(`${base}/mdp/arc/att/attachment/add`, params); };

//批量修改某些字段
export const editSomeFieldsAttachment = params => { return axios.post(`${base}/mdp/arc/att/attachment/editSomeFields`, params); };